﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using BlackHole.DAO;

namespace BlackHole
{
    /// <summary>
    /// Summary description for BlackholeService
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    [System.Web.Script.Services.ScriptService]
    public class BlackholeService : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        [WebMethod]
        public List<District> GetAllDistricts() 
        {
            return Utility.GetAllDistricts();
        }

        [WebMethod]
        public List<Device> GetAllDevices() 
        {
            return Utility.GetAllDevices();
        }

        [WebMethod]
        public List<Fault> GetFaultsByDevice(int deviceId) 
        {
            return Utility.GetFaultsByDeviceId(deviceId);
        }

        [WebMethod]
        public List<Owner> GetOwnersByDistrictId(int districtId) 
        {
            return Utility.GetOwnersByDistrictId(districtId);
        }

        [WebMethod]
        public List<Product> GetProdcutsBySerialNO(string serialNO,int statuId=0) 
        {
            return Utility.GetProductsDetailBySerialNO(serialNO, statuId);
        }

        [WebMethod]
        public List<Product> GetProdcutsByOwnerId(int ownerId, int deviceId = 0, int statusId = 0) 
        {
            return Utility.GetProductsDetailByOwnerId(ownerId, deviceId, statusId);
        }

      

    }
}
